package com.cedric.yixianpai.game.cards.Sects.swordCards.b_ZhuJi;

import com.cedric.yixianpai.game.Constants.CardType;
import com.cedric.yixianpai.game.Constants.Period;
import com.cedric.yixianpai.game.Status.DuelStatus;
import com.cedric.yixianpai.game.interfaces.SwordCard;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * 巨鲸灵剑
 */
@Component
public class JuJingLingJian extends SwordCard {

    /**
     * 巨鲸灵剑 -2灵气 16/20/24攻
     */
    public JuJingLingJian(@Value("1") int lvl) {
        super("巨鲸灵剑");
        this.setPeriod(Period.ZHUJI);
        this.setDescription("-2灵气 16/20/24攻");
        this.setCardType(CardType.LING);
        this.setSpiritNeed(2);
        if(1==lvl){
            this.setLevel(1);
            this.setDamage(16);
        }else if(2==lvl){
            this.setLevel(2);
            this.setDamage(20);
        }else if(3==lvl){
            this.setLevel(3);
            this.setDamage(24);
        }else{
            throw new RuntimeException("卡牌等级错误！");
        }
    }

    @Override
    public boolean effect(DuelStatus Sta1, DuelStatus Sta2) {
        if(Sta1.spiritEnough(this.getSpiritNeed())) {
            Sta1.attack(Sta2, this.getDamage());
            return true;
        }
        return false;
    }
}
